package com.yonyou.isv.demo.openapi.api.tax.entity.output_invoice;

import java.util.*;

/**
 *未开票收入管理
 * */
public class InvoiceWill {
    /**
     * 未开票记录变更查询
     * */
    public static Map<String, Object> change() {
        Map<String, Object> paramsMap = new HashMap<String, Object>();

        //发票号码
        paramsMap.put("beginTime","2019-10-24 16:31:15");
        paramsMap.put("endTime","2021-01-01 16:31:15");
        paramsMap.put("orgCode", "342423");
        paramsMap.put("pageNum", 2);
        paramsMap.put("pageSize", 15);

        return paramsMap;
    }

    /**
     * 未开票查询
     */
    public static Map<String, Object> result() {
        Map<String, Object> paramsMap = new HashMap<String, Object>();
        //发票代码
        paramsMap.put("lyid", "");
        //发票号码
        paramsMap.put("djqqlsh", "23770399");
        paramsMap.put("orgCode", "342423");
        paramsMap.put("pageNum", "1");
        paramsMap.put("pageSize", "10");
        return paramsMap;
    }

    //新增未开票
    public static Map<String, Object> save() {
        Map<String, Object> paramsMap = new HashMap<String, Object>();
        //发票代码
        paramsMap.put("lyid", "1");
        //发票号码
        paramsMap.put("djqqlsh", "23770399");
        paramsMap.put("orgCode", "342423");
        paramsMap.put("gmfMc", "广州佰仕德材料科技有限公司");
        paramsMap.put("gmfNsrsbh", "111222333456111");
        paramsMap.put("gmfYhzh", "中国农业银行股份有限公司广州花都名门支行 44087001040011474");
        paramsMap.put("gmfDzdh", "广州市花都区红棉大道北16号4楼4B07室 020-61796191");
        paramsMap.put("zdrq","2020-09-09");
        paramsMap.put("invoiceWillBs",buildWillbs());
        return paramsMap;
    }

    private static Object buildWillbs() {

        Map<String, Object> paramsMap = new HashMap<String, Object>();
        paramsMap.put("xmmc", "硅胶5299B");
        paramsMap.put("xmjshj", 40);
        paramsMap.put("hh","1");
        paramsMap.put("spbm", "1070213070000000000");
        paramsMap.put("sl", 0.16);
        return paramsMap;
    }
    //新增红字信息表
    public static Map<String, Object> apply() {
        Map<String, Object> paramsMap = new HashMap<String, Object>();
        paramsMap.put("orgCode", "342423");
        paramsMap.put("reqMemo", "1100000000");
        paramsMap.put("GMF_MC", "用友金融信息技术股份有限公司123");
        paramsMap.put("gmfNsrsbh", "111222333456111");
        paramsMap.put("xsfNsrsbh", "111222333456111");
        paramsMap.put("xsfMc", "测试333");
        paramsMap.put("gmfMc", "测试123");
        paramsMap.put("kprq","202101");
        paramsMap.put("items",buildItems());
        paramsMap.put("hjje",-99.01);
        paramsMap.put("hjse",-0.99);
        paramsMap.put("jshj",-100);
        paramsMap.put("reqBillNo","3211ss232123");
        paramsMap.put("resBillNo","88888888");
        return paramsMap;
    }

    /**
     * 构造request发票明细
     */
    private static List<Object> buildItems() {
        List<Object> items = new ArrayList<Object>();
        Map<String, Object> data1 = new HashMap<String, Object>();

        data1.put("xmjshj", -100);
        data1.put("ysxmmc", "橡皮");
        data1.put("xmmc", "*运输服务*橡皮");
        data1.put("xmdj","23.0041942911");
        data1.put("xmhsdj","23.234213");
        data1.put("ggxh", "一二三四五六七八");
        data1.put("dw", "一二三");
        data1.put("xmsl", "-4.3039977296");
        data1.put("se", -0.99);
        //税率16%需要写成0.16的格式
        data1.put("sl", 0.01);
        data1.put("xmje",-99.01);
        data1.put("spbm", "3213124314324322");
        items.add(data1);

        return items;
    }

    /**
     * 销项查询并推送档案服务
     * @return
     */
    public static Map<String, Object> outputQueryBillspush() {
        Map<String, Object> paramsMap = new HashMap<String, Object>();
        paramsMap.put("callbackUrl", "https://idoc.diwork.com//cloudrecord-imw/api/nc/v1/doc/push?corpId=1634");
        paramsMap.put("showUpper", "1");
        paramsMap.put("taskId", "S202111-173490-a559dc1db5f2");
        paramsMap.put("type", "fa_fixedasset_FixedAssetsInfo");
        paramsMap.put("docPkList", Arrays.asList(new String[]{"2444139785392640"}));
        Map<String, Object> fileServer = new HashMap<String, Object>();
        fileServer.put("accessKey", "idocyonyoucloudcom");
        fileServer.put("bucketName", "idoc");
        fileServer.put("endpoint", "https://yonbip.diwork.com/yonbip-fi-eaffile/cloudrecord-file");
        fileServer.put("secretKey", "idocyonyoucloudcom");
        fileServer.put("serverType", "gateway");
        paramsMap.put("fileServer", fileServer);
        Map<String, Object> orgInfo = new HashMap<String, Object>();
        orgInfo.put("code", "001_0001");
        orgInfo.put("type", "book");
        paramsMap.put("orgInfo", orgInfo);
        return paramsMap;
    }

    /**
     * 进项查询并推送档案服务
     * @return
     */
    public static Map<String, Object> inputQueryBillspush() {
        Map<String, Object> paramsMap = new HashMap<String, Object>();
        paramsMap.put("callbackUrl", "https://idoc.diwork.com//cloudrecord-imw/api/nc/v1/doc/push?corpId=1634");
        paramsMap.put("showUpper", "1");
        paramsMap.put("taskId", "S202111-173490-a559dc1db5f2");
        paramsMap.put("type", "fa_fixedasset_FixedAssetsInfo");
        paramsMap.put("docPkList", Arrays.asList(new String[]{"2444139785392640"}));
        Map<String, Object> fileServer = new HashMap<String, Object>();
        fileServer.put("accessKey", "idocyonyoucloudcom");
        fileServer.put("bucketName", "idoc");
        fileServer.put("endpoint", "https://yonbip.diwork.com/yonbip-fi-eaffile/cloudrecord-file");
        fileServer.put("secretKey", "idocyonyoucloudcom");
        fileServer.put("serverType", "gateway");
        paramsMap.put("fileServer", fileServer);
        Map<String, Object> orgInfo = new HashMap<String, Object>();
        orgInfo.put("code", "001_0001");
        orgInfo.put("type", "book");
        paramsMap.put("orgInfo", orgInfo);
        return paramsMap;
    }
}
